home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-15 / fdc_8477.zip / 77DEMO.DOC next >
Text File  |  1991-06-15  |  14KB  |  145 lines

  1. National Semiconductor
  2. PC Products Applications
  3. Steve Horeff
  4. November 1990
  5.  
  6. PC8477 Advanced Floppy Disk Controller
  7. Demo Program User's Guide
  8.  
  9. INTRODUCTION
  10.  
  11. The PC8477 Demo Program is designed to allow access to all software commands and registers of National Semiconductor's PC8477 Advanced Floppy Disk Controller.  The demo program will automatically detect a PC8477, DP8473 or 82077 floppy controller and allow all commands of these controllers to be implemented.  This demo program will also work with any floppy disk controller that is software compatible with the NEC765.  It allows the user to easily experiment with these floppy disk controllers and is controlled by a series of pop-up menus.
  12.  
  13. Also included on the PC8477 demo disk is a functional test program called "fdc_test.exe".  This program will perform a series of diagnostic tests on the floppy controller.  The file "fdc_test.doc", also on the demo disk, describes the operation of this test program.
  14.  
  15. GETTING STARTED
  16.  
  17. To start the PC8477 Demo Program, simply run the program called "77demo.exe" from the demo program disk.  When the program is first started it will automatically perform a reset and initialization of the floppy controller.  This reset is the same as the Reset With Specify menu option described later.  If a reset is not desired when the program is started, type "77demo -nr" to start the program.  "nr" indicates "no reset".
  18.  
  19. When it is first executed, the program will also ascertain which controller is installed in the system, whether it be a PC8477, DP8473, 82077 or NEC765 compatible controller.  After this procedure is completed, you are placed in the background mode.
  20.  
  21. The background mode displays the data that was transferred from the last command.  Since no data has yet been transferred, this area is blank (except for the introductory title).  The top line has some other information.  The top far left position is used by the port I/O routines explained later.  The left center indicates the number of bytes transferred during the last command issued.  The right center reflects the current state of the INT pin.  The right position shows the current value of the Main Status Register in the floppy controller.  This top line is only valid while in the background mode, not during the execution of a command.  While in the background mode, the MSR will be polled continuously by the software.  Once a popup menu is on the screen, the MSR polling will stop.
  22.  
  23. HOW TO USE THE DEMO PROGRAM
  24.  
  25. To execute a command or function, you can access the menus from the background mode by hitting the space bar.  This will pop up the main menu, from which all the functions of the floppy demo program are accessed.  As an item in the menu is chosen, another menu will appear if appropriate.  This technique of popping up menus continues until the desired function is chosen.
  26.  
  27. There are three methods for choosing the desired selection in a menu. The space bar will advance the highlight to the next selection.  The up and down cursor keys can also move the highlight.  After the desired selection is highlighted, hitting the return key will execute the selection.  The third method of choosing a selection is to use the "hot" key.  This is done by simply hitting the first letter of a selection, (the letter in parentheses), which will both highlight and execute the selection.  To abort the current menu, hit the ESC key.  This will either erase the current menu or erase all the menus on the screen and return to the background mode.
  28.  
  29. After any command is finished executing, two things may occur.  Commands with a Result Phase will display this status information on the screen.  You can return to the background mode by hitting the space bar.  If there is no Result Phase, the program will return to the background mode automatically.  While in the background mode,  the displayed data can be scrolled with the page up, page down, home and end keys.  This data is depicted in two formats.  The main block in the center of the screen shows the hex representation of the bytes transferred.  To the right of this block is the ASCII character representation for each corresponding byte.  The column of hexadecimal numbers on the left shows the relative address of each corresponding row of bytes.
  30.  
  31. MENU DESCRIPTIONS
  32.  
  33. Now that you know your way around the PC8477 Demo Program, you need to know what the various functions and commands will do when executed.  The remainder of the user's guide will describe each function supported by the demo program.  Each function in this guide is arranged according to how it is accessed in the menu structure.
  34.  
  35. MAIN MENU
  36.  
  37. (R) Reset
  38.  
  39. With Specify
  40. Issues a software reset to floppy controller followed by four Sense Interrupt commands, a Specify command and Recalibrate command with Sense Interrupt.  This function is performed automatically when program is first started.
  41.  
  42. Reset Only
  43. Issues a software reset to floppy controller.
  44.  
  45. One Sense Int
  46. Same as Reset With Specify except only one Sense Interrupt command is issued instead of four after the reset.
  47.  
  48. (F) Floppy Command
  49.  
  50. This section is the most useful portion of the demo program.  You can execute all the commands of the floppy disk controller from this menu.  For most of the floppy commands executed in the program, you will see the Command Phase bytes on the screen (see the PC8477 data sheet for the command byte listing for each command).  These command bytes contain default values when the program is started, but can be easily altered.  Use the cursor arrow keys to move the cursor to the appropriate bit or byte in the command block.  Then enter the appropriate bit or hex value to the bit or byte location respectively.
  51.  
  52. For some commands like the read and write commands, all of the command bytes cannot fit on the screen at one time.  To access the command bytes that are not shown, simply move the cursor up or down until the hidden command bytes are scrolled onto the screen.  Once the command bytes have been set to their desired values, hit return and the command will execute.
  53.  
  54. When commands have finished the Execution Phase, the Result Phase bytes will be displayed on the screen, indicating whether the command was completed successfully or not.  Hit the space bar to return to the background mode.  If a read operation was performed, the data read from the disk is displayed on the screen.
  55.  
  56. For certain commands, the program will determine the drive selected by the user and enable the corresponding drive select and motor select outputs automatically.  This function is performed for all read, write, format, verify, seek and recalibrate commands.
  57.  
  58. The Seek and Recalibrate commands will issue a Sense Interrupt automatically unless this option is disabled via the Option menu.  DMA data transfers will be the default mode unless Polling mode is enabled via the Option menu.
  59.  
  60. (R) Read
  61. Executes the Read ID or other Read Data commands.  The data read during the Read Data commands is displayed in the background buffer.  The Read ID command will issue 20 consecutive Read ID commands and display all the result phase bytes in tabular format on the screen.
  62.  
  63. (W) Write
  64. Executes the write and format commands.  The data written to the disk during write commands is taken from the background buffer.  For format operations, the ID field header bytes written to the disk are also taken from the background buffer.  You can use the Transfer File-Read menu to call up the data file "format.dat" to the background buffer for this purpose.
  65.  
  66. Other Commands
  67. The remaining commands under the Floppy Command menu are easy to execute.  Consult the floppy controller data sheet for more details about a particular command if desired.
  68.  
  69. (.) Registers
  70.  
  71. This menu allows the user to directly access all floppy controller registers.  Some registers are not supported by all modes of the PC8477.  For example, if the controller is in PC-AT mode, then Status Register A will be TRI-STATE.  This will be evident when the register contents are returned as FF hex by the program.  Also, some other PC-AT compatible controllers will not support registers supported by the PC8477.
  72.  
  73. The program will allow the user to read and write bidirectional registers, or only read or write registers that are read-only or write-only respectively.  When writing to a register, the bits can be altered by using the cursor arrow keys and entering a 1 or 0.
  74.  
  75. (T) Transfer File
  76.  
  77. Read
  78. Reads a data file from a disk drive and copies it to the background buffer.  The default drive and path is where the "floppy.exe" was executed.  If this is not the desired directory for the file to be read, then the path must be specified along with the file name.  This command only reads files with a .DAT extension.  Three .DAT files are included on the Floppy Demo Program disk:  FORMAT.DAT, COUNT.DAT, and DB6.DAT.  FORMAT.DAT is useful when issuing the format command.  The other two files are useful data patterns, the DB6 pattern being the worst case data pattern for testing the data separator.
  79.  
  80. Write
  81. Writes the hex pattern in the background buffer to the specified file name.  The default directory path is used if none is specified.  This function is useful for creating custom data patterns and storing them on the hard disk for future use.
  82.  
  83. (O) Options
  84.  
  85. (D) Data Transfer Options
  86. Select between using DMA or software polling for the data transfers.  The Specify command must be issued after changing the data transfer mode.
  87.  
  88. (S) Sense Int after Seek
  89. Select whether to issue a Sense Interrupt command automatically after the end of a Seek or Recalibrate command.  If disabled, a Sense Interrupt command should be issued manually after a Seek or Recalibrate to deassert the INT pin.
  90.  
  91. (P) PC Data Rate Select
  92. Sets the data rate for the PC8477 or PC compatible floppy controller by writing to the Configuration Control register.
  93.  
  94. (T) DMA Transfer Length Override
  95. Normally the program will set the data transfer length for the DMA controller automatically from the information imbedded within the read, write, format or scan command.  During a read command for example, the program will set the DMA transfer length equal to (End of Track ╨ Sector number +1) x (# Bytes/Sector).  The DMA transfer length can be set manually with this option.
  96.  
  97. (R) Relocate I/O
  98. Selects the base I/O address for floppy controller.  The PC compatible range is default (3F0╨3F7 hex).  Another base address can be chosen if desired.  The user is responsible for making sure that this address range does not conflict with other peripherals in the system.
  99.  
  100. (L) Long Term Read with Reset
  101. This option allows a software reset to be issued before each read during Long Term Read tests.  Useful for diagnostic purposes.
  102.  
  103. (D) Diagnostics
  104.  
  105. (R) Long Term Read
  106. This will perform a read command repeatedly while monitoring the errors that are detected, as well as the number of passes.  Useful for long term error evaluation.  
  107.  
  108. (W) Long Term Write
  109. This will perform a write command followed by a read command repeatedly while monitoring for errors from either command.  Useful for long term error evaluation.
  110.  
  111. (C) Check Disk
  112. Issues a Read command for each track on a disk and reports any errors.  Useful for finding bad sectors on a disk.
  113.  
  114. (T) Test Chip
  115. Performs a series of commands that will test for basic functionality of the floppy controller and data separator.  Performs a reset, sense interrupt, recalibrate, seek to track 20, format, write data, recalibrate, seek to track 20, read data and compare data operation in that order.  A disk must be in drive 0.  Be sure that this disk is not important, as track 20 will be altered with this test.  An unformatted disk is acceptable.
  116.  
  117. (F) Flexstar
  118. This is a special diagnostic function that requires special external hardware and is not included with the standard floppy demo program.  It is used to measure the static and dynamic window margin of the data separator.
  119.  
  120. (S) Special
  121. This diagnostic mode allows for special testing of the floppy controller.  For example, specific command sequences can be issued for debugging purposes.  See the source code listing for more details.
  122.  
  123. (D) Diagnostic Pins
  124. This option is available for the PC8477 and DP8473 controllers and is intended for internal NSC use only.
  125.  
  126. (E) Edit
  127.  
  128. Enters the Edit mode from the background mode.  This will allow the user to edit the hex data displayed in the background buffer.  Use the cursor arrow keys, home, end, page up, and page down keys to move the cursor to the desired location, then enter the hex value.  The cursor will advance automatically.  Use the ESC key to return to background mode.
  129.  
  130. (I) I/O
  131.  
  132. Performs reads or writes to any I/O port in the PC.  The result of a read is displayed in the top left corner of display.  The Turn on Motor option asserts the drive 0 select and motor 0 select lines, causing the drive motor to spin.
  133.  
  134. (Q) Quit
  135.  
  136. Return to DOS.
  137.  
  138. SUMMARY
  139.  
  140. Included on the PC8477 demo disk is the "77DEMO.EXE" executable file, the C code for the program modules (except the pop-up menu module for which the object code is given), the "floppy.h" and "popup.h" include files, the floppy controller device driver assembly code and the three .DAT files for file transfers
  141.  
  142. Feel free to modify this program if desired.  The source code is included on the disk.  Microsoft C 5.0 was used to compile the C code and Microsoft Macro Assembler 5.0 for the assembly code.  The Make utility with the make file called "77DEMO" is also included on the floppy demo disk.  Use this utility and file to recompile the Floppy Demo Program if any changes are made to the demo program source code.
  143.  
  144. As mentioned, the demo disk also contains the functional test program "fdc_test.exe" along with a description file called "fdc_test.doc".
  145.